// index.js
const api = require('../../api/api')
const util = require('../../utils/js/util')
Page({
  data: {
    safeToBottom: util.getSafeToBottom(),
    detail: null,
    id: '',
    from: '',
  },
  onLoad(options) {
    this.setData({ id: options.id, from: options.from })
    this.getDetail()
  },
  async getDetail() {
    const res = this.data.from == 'tip' ? await api.getTips({ id: this.data.id }) : await api.getDetail({ id: this.data.id })
    this.setData({ detail: res.content })
  }
});